Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: V8: cherry-pick c172ffc5bf54 #57437

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tunamagur0
Copy link

fix: #57412

This upstream V8 commit fixes the issue where the size of RetainedMaps continuously increases, leading to higher memory usage.

This issue has been occurring since AddRetainedMap was changed to AddRetainedMaps in the commit d8c97e48573ef9679751be0c7a308e08d0101c47.

As a result, the Main branch, v23.x.x, and v22.x.x should need this.

Original commit message:

Compact retained maps array more often

When we add maps to the retained maps array, we compacted the array if
it's full. But, since we are now adding maps in a batch, it's unlikely
to meet the condition. Thus, update the condition to check whether new
size exceeds the capacity.

Bug: 398528460
Change-Id: I89caa47b69532c6397596edfe5caf7c7d24768cc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6330019
Reviewed-by: Michael Lippautz <[email protected]>
Commit-Queue: Choongwoo Han <[email protected]>
Cr-Commit-Position: refs/heads/main@{#99163}

Refs: v8/v8@c172ffc

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/gyp
  • @nodejs/security-wg
  • @nodejs/v8-update

@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. needs-ci PRs that need a full CI run. v8 engine Issues and PRs related to the V8 dependency. labels Mar 13, 2025
@tunamagur0 tunamagur0 marked this pull request as draft March 13, 2025 09:45
Original commit message:

    Compact retained maps array more often

    When we add maps to the retained maps array, we compacted the array if
    it's full. But, since we are now adding maps in a batch, it's unlikely
    to meet the condition. Thus, update the condition to check whether new
    size exceeds the capacity.

    Bug: 398528460
    Change-Id: I89caa47b69532c6397596edfe5caf7c7d24768cc
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6330019
    Reviewed-by: Michael Lippautz <[email protected]>
    Commit-Queue: Choongwoo Han <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#99163}

Refs: v8/v8@c172ffc
@tunamagur0 tunamagur0 force-pushed the retained-map-increase branch from 2dd51aa to 282a23e Compare March 13, 2025 09:59
@tunamagur0 tunamagur0 marked this pull request as ready for review March 13, 2025 10:00
@richardlau richardlau added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 14, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 14, 2025
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@targos targos added the lts-watch-v22.x PRs that may need to be released in v22.x label Mar 14, 2025
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@richardlau richardlau added the commit-queue Add this label to land a pull request using GitHub Actions. label Mar 15, 2025
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Mar 15, 2025
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/57437
✔  Done loading data for nodejs/node/pull/57437
----------------------------------- PR info ------------------------------------
Title      deps: V8: cherry-pick c172ffc5bf54 (#57437)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     tunamagur0:retained-map-increase -> nodejs:main
Labels     build, v8 engine, needs-ci, lts-watch-v22.x
Commits    1
 - deps: V8: cherry-pick c172ffc5bf54
Committers 1
 - tunamagur0 <[email protected]>
PR-URL: https://github.com/nodejs/node/pull/57437
Fixes: https://github.com/nodejs/node/issues/57412
Refs: https://github.com/v8/v8/commit/c172ffc5bf54e704558103973e1d5cb7aec491cb
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/57437
Fixes: https://github.com/nodejs/node/issues/57412
Refs: https://github.com/v8/v8/commit/c172ffc5bf54e704558103973e1d5cb7aec491cb
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Thu, 13 Mar 2025 09:42:27 GMT
   ✔  Approvals: 3
   ✔  - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/57437#pullrequestreview-2683348686
   ✔  - Michaël Zasso (@targos) (TSC): https://github.com/nodejs/node/pull/57437#pullrequestreview-2684581458
   ✔  - Richard Lau (@richardlau) (TSC): https://github.com/nodejs/node/pull/57437#pullrequestreview-2685912551
   ✘  Last GitHub CI failed
   ℹ  Last Full PR CI on 2025-03-15T00:39:12Z: https://ci.nodejs.org/job/node-test-pull-request/65762/
- Querying data for job/node-test-pull-request/65762/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/13871726497

@richardlau richardlau added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Mar 15, 2025
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Mar 15, 2025
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/57437
✔  Done loading data for nodejs/node/pull/57437
----------------------------------- PR info ------------------------------------
Title      deps: V8: cherry-pick c172ffc5bf54 (#57437)
Author     tunamagur0 <[email protected]> (@tunamagur0, first-time contributor)
Branch     tunamagur0:retained-map-increase -> nodejs:main
Labels     build, v8 engine, needs-ci, lts-watch-v22.x
Commits    1
 - deps: V8: cherry-pick c172ffc5bf54
Committers 1
 - tunamagur0 <[email protected]>
PR-URL: https://github.com/nodejs/node/pull/57437
Fixes: https://github.com/nodejs/node/issues/57412
Refs: https://github.com/v8/v8/commit/c172ffc5bf54e704558103973e1d5cb7aec491cb
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/57437
Fixes: https://github.com/nodejs/node/issues/57412
Refs: https://github.com/v8/v8/commit/c172ffc5bf54e704558103973e1d5cb7aec491cb
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Thu, 13 Mar 2025 09:42:27 GMT
   ✔  Approvals: 3
   ✔  - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/57437#pullrequestreview-2683348686
   ✔  - Michaël Zasso (@targos) (TSC): https://github.com/nodejs/node/pull/57437#pullrequestreview-2684581458
   ✔  - Richard Lau (@richardlau) (TSC): https://github.com/nodejs/node/pull/57437#pullrequestreview-2685912551
   ✘  Last GitHub CI failed
   ℹ  Last Full PR CI on 2025-03-15T09:50:32Z: https://ci.nodejs.org/job/node-test-pull-request/65762/
- Querying data for job/node-test-pull-request/65762/
   ✔  Last Jenkins CI successful
   ⚠  PR author is a new contributor: @tunamagur0([email protected])
   ⚠  - commit 282a23e4c16e is authored by [email protected]
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/13873396665

@tunamagur0
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. commit-queue-failed An error occurred while landing this pull request using GitHub Actions. lts-watch-v22.x PRs that may need to be released in v22.x needs-ci PRs that need a full CI run. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory leak due to increasing RetainedMaps size in V8 (Fixed upstream)
6 participants